#ifndef DATATYPES_HEADER
#define DATATYPES_HEADER

using namespace std;

#include <vector>
#include <string.h>
#include <fstream>
#include <sstream>
#include <iostream>

#include <math.h>                   
#include <stdio.h>
#include <time.h>
#include <stdlib.h>

#ifndef WIN32
#include <sys/times.h>
#endif

// defining data types
typedef double         DOUBLE;
typedef double         REAL_NUMBER;
typedef unsigned char  UCHAR;
typedef char           CHAR;
typedef unsigned long  UINT;
typedef long           INT;
typedef unsigned short USHORT;
typedef short          SHORT;
typedef void           VOID;


enum KERNELS {
  K_RBF = 1,
  K_POLY,
  K_PERCEPTRON,
  K_LINEAR
};

enum DATA {
  D_NORMAL = 1,
  D_SPARSE,
  D_BINARY
};

enum VERSIONS {
  V1_00b = 1,
  V1_01b,
  V1_02b,
  V1_03b,
  V1_04b,
  V1_05b,  // this version introduces a scale parameter	
  V1_06b,  // number of iterations in output file
  V1_00    // sparse and binary data optimizations
};

enum MSG_LEVELS{
  GENERAL_MSGS = 1,
  DETAILED_MSGS,
  SPECIFIC_MSGS,
  DEBUG_MSGS
};

#define CURRENT_SMO_VERSION	V1_00
#define CURRENT_KMEANS_VERSION	V1_00
#define CURRENT_SVMEDR_VERSION	V1_00
#define CURRENT_FCM_VERSION	V1_00

typedef vector<REAL_NUMBER>          REAL_VECTOR;
typedef vector<INT>	             INT_VECTOR;
typedef vector<vector<REAL_NUMBER> > REAL_MATRIX;
typedef vector<vector<INT> >         INT_MATRIX;

#ifndef _MAX_PATH
#define _MAX_PATH 255
#endif

#ifndef FALSE
#define FALSE 0
#endif

#ifndef TRUE
#define TRUE 1
#endif

// defines

#ifndef CLK_TCK
#define CLK_TCK 100
#endif

#define MIN(x,y) ((x)>(y)?(y):(x))
#define MAX(x,y) ((x)<(y)?(y):(x))
#ifdef WIN32
#define RAND(x)  ((INT        ) ((             (x))*((REAL_NUMBER)rand())/RAND_MAX))
#define RANDR(x) ((REAL_NUMBER) (((REAL_NUMBER)(x))*((REAL_NUMBER)rand()/(REAL_NUMBER)RAND_MAX)))
#define SRAND(x) srand(x)
#else
#define RAND(x)  ((INT        ) (drand48()*(x)))
#define RANDR(x) ((REAL_NUMBER) (drand48()*(x)))
#define SRAND(x) (srand48(x))
#endif
#define ABS(x)		 ((x)>=0?(x):(-(x)))
#define SIGN(x)		 ((x)>=0?1:-1)

#endif /* DATATYPES_HEADER */
